"""类和实例
定义一个 Person 类和 Student 子类，讲述类、对象（实例）、属性、方法、封装、继承
"""
class Person:
    def __init__(self, name, age, sex):
        # 初始化
        self._name = name
        self._age = age
        self._sex = sex
    
    def info(self):
        print(f"姓名:{self._name}, 年龄:{self._age}, 性别:{self._sex}")

class Student(Person):
    def __init__(self, name, age, sex, college, classnumber):
        super().__init__(name, age, sex)
        self._college = college
        self._classnumber = classnumber
    
    def info(self):
        super().info()
        print(f"学院:{self._college}, 班级:{self._classnumber}")


if __name__ == '__main__':
    zhang = Person("张三", 19, "男")
    zhang.info()

    li = Student("李四", 20, "男", "计算机学院", "35班")
    li.info()